#include <iostream>
using namespace std;
class Base1{
public:
	 Base1(int x){b1=x; cout<<"A";}
	int b1;
};

class Base2{
public:
	 Base2(){b2++; cout<<"B";}
	 static int b2;
};

int Base2::b2=0;

class Base3{
public:
	 Base3(int y): b3(y){cout<<"C";}
	int b3;
};

class Derived: public Base2,public Base3,public Base1 {
public:
	Derived(int a,int b,int c):m1(a),Base1(b),Base3(c){ }
	void Display(){cout<<b1<<","<<b2<<","<<b3<<endl; }
private:
	Base1 m1;
	Base2 m2;
};
int main(){
	Derived d(2,3,4);
	cout<<endl;
	d.Display();
	return 0;}



